package com.xq.sboot.servlet;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * 功能说明:手动注册Listener的类.不加@WebListener注解.
 * <p>创建时间:2018-12-14 13:24</p>
 *
 * @author <a href="https://gitee.com/gkq/microservice">郭凯强</a>
 * @since 1.0.0
 */
public class ManualListener implements ServletContextListener {
    private final Logger logger = LoggerFactory.getLogger(ManualListener.class);
    private final Marker marker = MarkerFactory.getMarker("ManualListener");


    @Override
    public void contextInitialized(ServletContextEvent sce) {
        logger.debug(marker, "{}初始化开始...",sce.getSource());
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        logger.debug(marker, "{}关闭...",sce.getSource());
    }

}
